package com.shrimpcolo.johnnytam;

import javax.swing.plaf.synth.SynthSeparatorUI;

/**
 * 
 * @author Johnny Tam
 *	1) 为什么要使用构造方法
 *	 ==》 使用构造方法的好处
 */
public class TestConstructor {

	public static void main(String[] args) {
		//v0.1使用普通包访问权限的属性，直接赋值
//		School school = new School();
//		school.schoolName = "成都";
//		school.classNumber = 8;
//		school.labNumber = 10;
//		
//		school.showCenter();
//		System.out.println();
//		
//		School bjSchool = new School();
//		bjSchool.schoolName = "北京";
//		bjSchool.classNumber = 3;
//		bjSchool.labNumber = 5;
//		
//		bjSchool.showCenter();
		
		
		//v0.2 为了封装， 将School类属性全部变为private
//		School school = new School();
//		school.setSchoolName("成都");
//		school.setClassNumber(8);
//		school.setLabNumber(10);
//		
//		school.showCenter();
//		System.out.println();
//		
//		School bjSchool = new School();
//		school.setSchoolName("北京");
//		school.setClassNumber(3);
//		school.setLabNumber(5);
//		
//		bjSchool.showCenter();
		
		
		//v0.3 为了封装， 将School类属性全部变为private, 并且在构造某个对象的时候就赋值
		SchoolNew cdShcool = new SchoolNew("成都", 8, 10);
		cdShcool.showCenter();
		
		SchoolNew bjShcool = new SchoolNew("北京", 3, 5);
		bjShcool.showCenter();
		

	}

}
